<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Experimental 2D Features Matching Algorithm</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Experimental 2D Features Matching Algorithm<div class="ingroups"><a class="el" href="../../d1/db4/group__xfeatures2d.html">Extra 2D Features Framework</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaaf19e0024c555f8d8982396376150288"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd9/group__xfeatures2d__match.html#gaaf19e0024c555f8d8982396376150288">cv::xfeatures2d::matchGMS</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp;size1, const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp;size2, const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp;keypoints1, const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp;keypoints2, const std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp;matches1to2, std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp;matchesGMS, const bool withRotation=false, const bool withScale=false, const double thresholdFactor=6.0)</td></tr>
<tr class="memdesc:gaaf19e0024c555f8d8982396376150288"><td class="mdescLeft"> </td><td class="mdescRight">GMS (Grid-based Motion Statistics) feature matching strategy described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Bian2017gms">[21]</a> .  <a href="../../db/dd9/group__xfeatures2d__match.html#gaaf19e0024c555f8d8982396376150288">More...</a><br/></td></tr>
<tr class="separator:gaaf19e0024c555f8d8982396376150288"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga55b555fffec434bf0cdf99b454056f7b"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd9/group__xfeatures2d__match.html#ga55b555fffec434bf0cdf99b454056f7b">cv::xfeatures2d::matchLOGOS</a> (const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp;keypoints1, const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp;keypoints2, const std::vector&lt; int &gt; &amp;nn1, const std::vector&lt; int &gt; &amp;nn2, std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp;matches1to2)</td></tr>
<tr class="memdesc:ga55b555fffec434bf0cdf99b454056f7b"><td class="mdescLeft"> </td><td class="mdescRight">LOGOS (Local geometric support for high-outlier spatial verification) feature matching strategy described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Lowry2018LOGOSLG">[155]</a> .  <a href="../../db/dd9/group__xfeatures2d__match.html#ga55b555fffec434bf0cdf99b454056f7b">More...</a><br/></td></tr>
<tr class="separator:ga55b555fffec434bf0cdf99b454056f7b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This section describes the following matching strategies:</p><ul>
<li>GMS: Grid-based Motion Statistics, <a class="el" href="../../d0/de3/citelist.html#CITEREF_Bian2017gms">[21]</a></li>
<li>LOGOS: Local geometric support for high-outlier spatial verification, <a class="el" href="../../d0/de3/citelist.html#CITEREF_Lowry2018LOGOSLG">[155]</a> </li>
</ul>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaaf19e0024c555f8d8982396376150288"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf19e0024c555f8d8982396376150288">◆ </a></span>matchGMS()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::xfeatures2d::matchGMS </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp; </td>
          <td class="paramname"><em>size1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp; </td>
          <td class="paramname"><em>size2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp; </td>
          <td class="paramname"><em>keypoints1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp; </td>
          <td class="paramname"><em>keypoints2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp; </td>
          <td class="paramname"><em>matches1to2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp; </td>
          <td class="paramname"><em>matchesGMS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const bool </td>
          <td class="paramname"><em>withRotation</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const bool </td>
          <td class="paramname"><em>withScale</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double </td>
          <td class="paramname"><em>thresholdFactor</em> = <code>6.0</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>matchesGMS</td><td>=</td><td>cv.xfeatures2d.matchGMS(</td><td class="paramname">size1, size2, keypoints1, keypoints2, matches1to2[, withRotation[, withScale[, thresholdFactor]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/daa/xfeatures2d_8hpp.html">opencv2/xfeatures2d.hpp</a>&gt;</code></p>
<p>GMS (Grid-based Motion Statistics) feature matching strategy described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Bian2017gms">[21]</a> . </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size1</td><td>Input size of image1. </td></tr>
    <tr><td class="paramname">size2</td><td>Input size of image2. </td></tr>
    <tr><td class="paramname">keypoints1</td><td>Input keypoints of image1. </td></tr>
    <tr><td class="paramname">keypoints2</td><td>Input keypoints of image2. </td></tr>
    <tr><td class="paramname">matches1to2</td><td>Input 1-nearest neighbor matches. </td></tr>
    <tr><td class="paramname">matchesGMS</td><td>Matches returned by the GMS matching strategy. </td></tr>
    <tr><td class="paramname">withRotation</td><td>Take rotation transformation into account. </td></tr>
    <tr><td class="paramname">withScale</td><td>Take scale transformation into account. </td></tr>
    <tr><td class="paramname">thresholdFactor</td><td>The higher, the less matches. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Since GMS works well when the number of features is large, we recommend to use the <a class="el" href="../../db/d95/classcv_1_1ORB.html" title="Class implementing the ORB (oriented BRIEF) keypoint detector and descriptor extractor. ">ORB</a> feature and set FastThreshold to 0 to get as many as possible features quickly. If matching results are not satisfying, please add more features. (We use 10000 for images with 640 X 480). If your images have big rotation and scale changes, please set withRotation or withScale to true. </dd></dl>
</div>
</div>
<a id="ga55b555fffec434bf0cdf99b454056f7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga55b555fffec434bf0cdf99b454056f7b">◆ </a></span>matchLOGOS()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::xfeatures2d::matchLOGOS </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp; </td>
          <td class="paramname"><em>keypoints1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="../../d2/d29/classcv_1_1KeyPoint.html">KeyPoint</a> &gt; &amp; </td>
          <td class="paramname"><em>keypoints2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>nn1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp; </td>
          <td class="paramname"><em>nn2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../d4/de0/classcv_1_1DMatch.html">DMatch</a> &gt; &amp; </td>
          <td class="paramname"><em>matches1to2</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.xfeatures2d.matchLOGOS(</td><td class="paramname">keypoints1, keypoints2, nn1, nn2, matches1to2</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/daa/xfeatures2d_8hpp.html">opencv2/xfeatures2d.hpp</a>&gt;</code></p>
<p>LOGOS (Local geometric support for high-outlier spatial verification) feature matching strategy described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Lowry2018LOGOSLG">[155]</a> . </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keypoints1</td><td>Input keypoints of image1. </td></tr>
    <tr><td class="paramname">keypoints2</td><td>Input keypoints of image2. </td></tr>
    <tr><td class="paramname">nn1</td><td>Index to the closest BoW centroid for each descriptors of image1. </td></tr>
    <tr><td class="paramname">nn2</td><td>Index to the closest BoW centroid for each descriptors of image2. </td></tr>
    <tr><td class="paramname">matches1to2</td><td>Matches returned by the LOGOS matching strategy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This matching strategy is suitable for features matching against large scale database. First step consists in constructing the bag-of-words (BoW) from a representative image database. Image descriptors are then represented by their closest codevector (nearest BoW centroid). </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:42 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
